<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  
  <link rel="stylesheet" href="/public/bootstrap.min.css">
  <link rel="stylesheet" href="/public/bootstrap-icons-141.css">
  <link rel="stylesheet" href="/public/style-light.css">
  
  <script src="/public/jquery.min.js"></script>
  <script src="/public/dayjs.min.js"></script>
  <script src="/public/bootstrap.bundle.min.js"></script>
  <script src="/public/util.js"></script>
  
  <title>Home - localtags</title>
</head>
<body>
  <div id="root" class="container" style="max-width: 775px; min-width: 400px;"></div>
  <script>

const Navbar = {
  view: () => m('nav').addClass('navbar navbar-light bg-light').append([
    m('div').addClass('container-fluid').append([
      m('span').addClass('PageTitle navbar-brand').text('localtags - Home'),
    ]),
  ]),
};

$('#root').append([
  m(Navbar).addClass('mt-2 mb-5'),
  m('div').append([
    create_item('Add Files', '/light/add', '添加文件'),
    create_item('Files', '/light/files', '最近文件'),
    create_item('Images', '/light/images', '最近图片'),
    create_item('Tag Groups', '/light/tag-groups', '最近标签组'),
    create_item('Tags', '/light/tags', '全部标签'),
    create_item('Search', '/light/search', '搜索'),
    create_item('Recycle Bin', '/light/files?filter=deleted', '回收站'),
    create_item('Config', '/light/config', '修改配置'),
    create_item('Information', '/light/info', '数据库信息'),
    create_item('Backup', '/light/backup', '备份'),
    m(Spacer),
    m('p').addClass('small text-secondary text-end').append([
      'localtags version: 2021-06-01',
      m('br'),
      m('i').addClass('small bi bi-box-arrow-up-right'),
      ' ',
      m('a').text('https://github.com/ahui2016/localtags').addClass('small text-secondary')
        .attr({href:'https://github.com/ahui2016/localtags',target:'_blank'}),
    ]),
  ]),
  m(BottomLine),
]);

function create_item(text, link, description) {
  return m('div').addClass('row mb-2 g-1').append([
    m('div').addClass('col text-end').append(
      m('a').text(text).attr({href:link}).addClass('text-decoration-none'),
    ),
    m('div').addClass('col').text(description),
  ]);
}
  
  </script>
</body>
</html>